<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="./public/css/index.css" rel="stylesheet">
<title>${mName}</title>
<script language="javascript" type="text/JavaScript">
	function show() {
		var selValue = document.getElementById("sel").value;
		console.log(selValue);
		window.location = "http://10.222.29.196:8080/amc-c/DishesServlet?t_id="
				+ selValue + "&m_id=${mId}";
	}
</script>
</head>
<body>
	<div class="div-body">
		<div class="nav-title-bar" >
			<span>AMC-Customer</span>
		</div>
		<div class="content-content" style="margin-left:13%;">
		<div style="text-align: center;"><label >菜品选择</label></div>
			<div class="table-menu" align="center">
				<select id="sel" onchange="show()">
					<c:forEach items="${type}" var="t">
						<option value="${t.key}" class="select-item"
							<c:if test="${t.key==tId}"><c:out value="selected"/> </c:if>>${t.value.typeName}</option>
					</c:forEach>
				</select><!-- 显示菜品下拉框 -->
			</div>
			<table>
				<c:forEach items="${dishes}" var="dish">
					<tr>
						<td style="width: 20px; text-align: center;"><img src="${dish.value.foodPic}"
							 width="200px" height="150px"></td>
						<td>
							<table>
								<tr>
									<td>菜名</td>
								</tr>
								<tr>
									<td>${dish.value.foodName }</td>
								</tr>
								<tr>
									<td>价格</td>
								</tr>
								<tr>
									<td>${dish.value.foodPrice }</td>
								</tr>
								<tr>
									<td>品类</td>
								</tr>
								<tr>
									<td>${dish.value.foodTypeName }</td>
								</tr>
							</table>
						</td>
					</tr>
				</c:forEach>
			</table>
			<div style="width: 100%; text-align: center;">
				<input class="dialog-input"
					style="background-color: #F0F0F0; height: 36px" type="button"
					value="返回菜单" onclick="location.href='DishesServlet?m_id=${mId}'">
			</div>
			<br>
			<div style="width: 100%; text-align: center;">
				<input class="dialog-input"
					style="background-color: #F0F0F0; height: 36px" type="button"
					value="商家列表" onclick="location.href='MainServlet'">
			</div>
		</div>
	</div>
</body>
</html>